Contents

  1. You want to do what?!?
  2. Getting started
  3. The desktop
  4. A pseudo-base class
  5. Joy and grief
  6. Timing is everything (or sometimes nothing)
  7. Conclusions / Lessons Learned

Startup and support

public class Finder implements Serializable {
	Finder() {
		// Mac envy
		try {
			UIManager.setLookAndFeel( "com.sun.java.swing.plaf.mac.MacLookAndFeel");
		}
		catch (Exception exc) {
			// Error - unsupported L&F

			System.err.println( "Unsupported LookAndFeel: MacLookAndFeel" );
		}

		// Create primary display
		Desktop d = new Desktop();
		d.repaint();
	}

	public static void main( String args[] ) {
		Finder f = new Finder();
	}
}

public class Global implements Serializable {
	// Position values
	public static final int defaultX = 0;
	public static final int defaultY = 0;
	public static final int defaultWidth = 640;
	public static final int defaultHeight = 480;

	// Frame component sizes
	public static final int defaultGrowBoxSize = 20;

	// Menu component sizes
	public static final int defaultMenuBarHeight = 20;
	public static final int defaultMenuHSep = 10;
	public static final int defaultMenuItemVSep = 2;

	// Timing values
	public static final int splashDelay = 2;
	public static final int menuDelayMillis = 40;

	// Colors
	public static final Color menuBarHighlightColor = Color.blue;
	public static final Color inactiveMenuColor = Color.lightGray;
	
	// Startup strings
	public static final String splashDisplayString = "Welcome to Mac OS";
	public static final String startupDisplayString = "Starting Up...";

	// Icon and menu strings
	public static final String trashDisplayString = "Trash";
	public static final String menuItemAboutMac = "About This Computer...";
	public static final String menuItemNew = "New Folder";
	public static final String menuItemOpen = "Open";
	// blah, blah, blah

	// File name string components
	public static final String spaceSep = "%20";
//	public static final String sep00 = "%aa";
	public static final char sep01 = '\\';
	public static final char sep02 = '/';
	public static final char sep03 = ':';

	// System properties (lookup once)
	public static final String fileSep = System.getProperty( "file.separator" );
	public static final String pathSep = System.getProperty( "path.separator" );
	public static final String lineSep = System.getProperty( "line.separator" );

	// Image names (same dir as app)
	public static final String splashString = new String( "splash.gif" );
	public static final String appleString = new String( "apple01.gif" );
	public static final String trashString = new String( "trash01.gif" );
	public static final String trashMaskString = new String( "trash01m.gif" );
	// blah, blah, blah
}

Object model

Most classes are Component descendants. Others should be.

Classroom layout

Partial object model.

PreviousNext